const proxyInterceptorHook = require("./mock/proxy-interceptor");
const { PROXY_INTERCEPTOR, PROXY_MOCK } = process.env;
const proxyMaps = {
  "/api": {
    target:
      PROXY_MOCK === "true" ? "http://localhost:7002" : "http://localhost:7003",
    changeOrigin: true,
    pathRewrite: {
      "^/api": ""
    }
  }
};
const proxy =
  PROXY_INTERCEPTOR === "true" ? proxyInterceptorHook(proxyMaps) : proxyMaps;
module.exports = {
  lintOnSave: false,
  devServer: {
    open: false,
    port: 8080,
    proxy
  }
};
